<html>
<head><meta charset="utf-8"><title>documenting how unwinding works per platform · project-ffi-unwind · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/index.html">project-ffi-unwind</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html">documenting how unwinding works per platform</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="178321393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178321393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178321393">(Oct 16 2019 at 19:36)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="132920">@gnzlbg</span> -- how well do you know the details of the unwinding mechanisms from various platforms?</p>
<p>It seems like it'd be useful to have some notes on how major unwinding mechanisms work in the repository as a kind of "background". I'd also be interested in scheduling some times to do a "deep dive" into each platform, where we could discuss.</p>
<p>Do you think you'd be able to provide some notes on x86_64, for example? I'm not sure if you're familiar with SEH.</p>



<a name="178321818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178321818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178321818">(Oct 16 2019 at 19:43)</a>:</h4>
<p>I’m only familiar with Itanium from reading the spec. Most platforms follow it, except for Windows. I only know very basic things about Windows.</p>



<a name="178321949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178321949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178321949">(Oct 16 2019 at 19:44)</a>:</h4>
<p>The Itanium spec is surprisingly readable, I definitely recommend it.</p>



<a name="178324161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178324161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178324161">(Oct 16 2019 at 20:10)</a>:</h4>
<p>ok, then maybe you'd like to leave some summary around itanium? (and perhaps a link to spec)</p>



<a name="178324263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178324263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> acfoltzer <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178324263">(Oct 16 2019 at 20:12)</a>:</h4>
<p>at this point we should probably be pointing to the section in the amd64 ABI (<a href="https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf" target="_blank" title="https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf">https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf</a>). it's pretty much a transcription of the Itanium one, but it's nicer to have the context from the rest of the ABI</p>



<a name="178324343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178324343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> acfoltzer <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178324343">(Oct 16 2019 at 20:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> seemed to know more about SEH than me when we spoke last week, so he might be able to help for Windows</p>



<a name="178361218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178361218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178361218">(Oct 17 2019 at 08:39)</a>:</h4>
<blockquote>
<p>at this point we should probably be pointing to the section in the amd64 ABI (<a href="https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf" target="_blank" title="https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf">https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf</a>). </p>
</blockquote>
<p>Yes, that's the normative document. I personally prefer to read <a href="https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html" target="_blank" title="https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html">https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html</a> because that's only the unwinding part, and its easier to hyperlink to different sections of it, than trying to do so for a PDF.</p>



<a name="178361321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178361321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178361321">(Oct 17 2019 at 08:41)</a>:</h4>
<p>The most relevant part for us <a href="http://is%20the%20https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html" target="_blank" title="http://is%20the%20https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html">Level 1. Base ABI</a> since the rest is C++ specific (although good to know if you care about how C++ treats its own exceptions)</p>



<a name="178361415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178361415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178361415">(Oct 17 2019 at 08:42)</a>:</h4>
<p>Within 1.6, sub-section "1.6.4 Rules for Correct Inter-Language Operation" is a very quick read</p>



<a name="178399089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178399089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> acfoltzer <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178399089">(Oct 17 2019 at 16:45)</a>:</h4>
<p>I guess I'm too used to my dog-eared paper copy at this point <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="178399386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178399386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178399386">(Oct 17 2019 at 16:48)</a>:</h4>
<p>It'd be great if somebody wanted to create a <code>background/README.md</code> file or something and add links like that</p>



<a name="178399406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/documenting%20how%20unwinding%20works%20per%20platform/near/178399406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/documenting.20how.20unwinding.20works.20per.20platform.html#178399406">(Oct 17 2019 at 16:48)</a>:</h4>
<p>I'll try to skim it soon but .. yeah busy :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>